Mod Name / Version Instant UBBCode boxes on PM v1.0<br />Description This is a hack that adds the Instant UBBCode boxes to the PM pages.<br />Working under UBB.threads 6.0.1<br />Any pre-requisites None<br />Author(s) Gardener<br />Credits JoshPet who came up with the idea<br />Demo See attached screenshot<br />Files Altered sendmessage.tmpl, sendprivate.tmpl, mess_handler.tmpl, mess_reply.tmpl, sendprivate.php, mess_handler.php, mess_reply.php, sendmessage.php<br />Database Altered No<br />New Files None<br />Any other info Please report any problems you might have and I'll try to fix them as soon as possible. I haven't given this much testing yet, but it seems to work for me.<br /><br /><br />Step 1<br />Edit the following template files: sendmessage.tmpl, sendprivate.tmpl, mess_handler.tmpl, mess_reply.tmpl<br /><br />First you will have to change the form tag in all these files. It is slightly different in some of the files, but that doesn't matter, there should only be one in each file. It will look something like this (and is at line 18 in most of them):<br /><pre><font class="small">code:</font><hr><form method="post" action="{$config['phpurl']}/sendmessage.php"></pre><hr><br /><br />Add the part in red below to the form. Make sure that the action attribute stays the same as before and that you remove the old name attribute!<br /><pre><font class="small">code:</font><hr><form[:"red"] name="replier"[/] method="post" action="{$config['phpurl']}/sendmessage.php"></pre><hr><br /><br />After that you will have to update the Textarea tag in all of the files. Find the tag that looks like this, again, there should only be one textarea tag in each file. If you have downloaded the zip-version of UBB.threads, the textarea tags might be called textareahtml instead. The two lines below are actually on one line in the files.<br /><pre><font class="small">code:</font><hr><textarea cols="$TextCols" rows="$TextRows" class="formboxes" <br />name="Message">$RawBody</textarea></pre><hr><br /><br />Change the parts in red below. Please make sure that the old name attribute is removed!<br /><pre><font class="small">code:</font><hr><textarea cols="$TextCols" rows="$TextRows" class="formboxes"[:"red"] <br />wrap="soft" name="Body" onkeyup="storeCaret(this);" <br />onclick="storeCaret(this);"[/]>$RawBody</textarea><br />$instant_ubbcode</pre><hr><br />Please note that the name attribute is changed, and that you won't have to insert the wrap="soft" in all files since it is already in some. It is also vitally important that the $instant_ubbcode is inserted after the textarea, otherwise the boxes won't show up.<br /><br /><br />Step 2<br />In the files sendmessage.tmpl and mess_reply.tmpl you will also have to change the input tag looking like this:<br /><pre><font class="small">code:</font><hr><input type="hidden" name="Message" value="$FormBody" /></pre><hr><br /><br />And change the red parts below. Note that the name attribute has changed, so the old one has to be removed. Also, since the value attribute is different, make sure you don't change that.<br /><pre><font class="small">code:</font><hr><input type="hidden"[:"red"] name="Body"[/] value="$FormBody" /></pre><hr><br /><br /><br />Step 3<br />Open up the files sendprivate.php, mess_handler.php and mess_reply.php and do the following:<br /><br />Find the line that looks something like this (it is the only one in each file that has the "send_header" part):<br /><pre><font class="small">code:</font><hr> $html -> send_header("{$ubbt_lang['PRIV_HEAD']} $User",$Cat,0,$user);</pre><hr><br /><br />And add this line before it:<br /><pre><font class="small">code:</font><hr> $instant_ubbcode = $html -> instant_ubbcode();</pre><hr><br /><br /><br />Step 4<br />Now open mess_reply.php and sendmessage.php and do the following in both files:<br /><br />Find this line near the beginning:<br /><pre><font class="small">code:</font><hr> $RawBody = $Message;</pre><hr><br /><br />And change it into this:<br /><pre><font class="small">code:</font><hr> $RawBody = $Body;<br /> $Message = $Body;</pre><hr><br />
Attachments
51967-PM_instantubbcode-1_0.zip (10 downloads)
Edited by canvey (12/27/02 03:35 PM)